package audi.a4.control.core;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class TrcFilter extends FileFilter {

	public String getDescription() {
		return "Trace File (trc)";
	}
	
	public boolean accept(File f) {
		if(f.isDirectory()) {
			return true;
		}
		String path = f.getAbsolutePath().toLowerCase();
		if ((path.endsWith("trc") && (path.charAt(path.length() - 3)) == '.')) {
			return true;
		}
		return f.getName().matches(".+\\.trc$");
	}

}
